package com.kun.music.service.impl;

import com.kun.music.dao.SingerMapper;
import com.kun.music.domain.Singer;
import com.kun.music.service.SingerService;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author fangkun
 * @create 2022-12-21-16:06
 */
@Service
public class SingerServiceImpl implements SingerService {

    @Autowired
    private SingerMapper singerMapper;

    @Override
    public List<Singer> allSinger() {
        return singerMapper.allSinger();
    }

    @Override
    public boolean addSinger(Singer singer) {
        return singerMapper.addSinger(singer)>0 ? true : false;
    }

    @Override
    public boolean updateSingerPic(Singer singer) {
        return singerMapper.updateSingerPic(singer) > 0 ? true : false;
    }

    @Override
    public boolean updateSingerInfo(Singer singer) {
        return singerMapper.updateSingerInfo(singer) > 0 ? true : false;
    }

    @Override
    public boolean deleteSinger(int id) {
        return singerMapper.deleteSinger(id) > 0 ? true : false;
    }

    @Override
    public List<Singer> singerByName(String name) {
        return singerMapper.singerByName(name);
    }
}
